<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../../html/Ajax.js"></script>
</head>

<body>
    <div class="box"></div>
    <input type="text" id="key">
    <button class="btn">按钮</button>
    <script>
        let key = document.querySelector('#key');
        let btn = document.querySelector('.btn');
        var index=1;
        btn.onclick = function () {

            pAjax({
                url: '../../5.5fenye.php',
                data:{
                   index:index,
                   len:20,
                }
            }).then(res => {
                res = JSON.parse(res);
                console.log(res);
            });
            index++;
            console.log(index);
        }
    </script>
</body>

</html>